package main

import "fmt"


func myPanic(){
	panic("a problem")
}

func main(){
	//基础用法
	defer func(){
		if r:=recover();r!=nil{
			fmt.Println("Recovered error:\n",r)
		}
	}()

	myPanic()
	fmt.Println("After myPanic~")
}